﻿using BankSystemWithCSharp.DataBase;
using BankSystemWithCSharp.UserPanel;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace BankSystemWithCSharp
{
    public class ATMDemoController : IDemo
    {
        private List<(string, string)> DemoAccount = new List<(string, string)>()
        {
            ("1", "111111"),
            ("2", "222222"),
        };
        ATMDemoForm form;
        public void AddDemo(Point startPos)
        {
            foreach (var item in DemoAccount)
            {
                BankDataBase.Intance.Register(item.Item1, item.Item2);
            }
            Point _startPos = startPos;
            // 新建一个窗口，以列表的形式显示示例账号和密码
            Task.Run(() =>
            {
                form = new ATMDemoForm(DemoAccount, _startPos);
                form.ShowDialog();
            });
        }
    }
}